home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / PInterfaces / PCI.p < prev    next >
Encoding:
Text File  |  1996-09-22  |  4.7 KB  |  169 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        PCI.p
  3.  
  4.      Contains:    Access Routines to PCI Config and I/O registers
  5.  
  6.      Version:    Technology:    PowerSurge 1.0.2
  7.                  Package:    Universal Interfaces 2.1.4
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT PCI;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __PCI__}
  30. {$SETC __PCI__ := 1}
  31.  
  32. {$I+}
  33. {$SETC PCIIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36. {$IFC UNDEFINED __TYPES__}
  37. {$I Types.p}
  38. {$ENDC}
  39. {$IFC UNDEFINED __NAMEREGISTRY__}
  40. {$I NameRegistry.p}
  41. {$ENDC}
  42.  
  43. {$PUSH}
  44. {$ALIGN MAC68K}
  45. {$LibExport+}
  46.  
  47. {  Types and structures for accessing the PCI Assigned-Address property. }
  48.  
  49. CONST
  50.     kPCIRelocatableSpace        = $80;
  51.     kPCIPrefetchableSpace        = $40;
  52.     kPCIAliasedSpace            = $20;
  53.     kPCIAddressTypeCodeMask        = $03;
  54.     kPCIConfigSpace                = 0;
  55.     kPCIIOSpace                    = 1;
  56.     kPCI32BitMemorySpace        = 2;
  57.     kPCI64BitMemorySpace        = 3;
  58.  
  59.  
  60. TYPE
  61.     PCIAddressSpaceFlags                = UInt8;
  62.  
  63. CONST
  64.     kPCIDeviceNumberMask        = $1F;
  65.     kPCIFunctionNumberMask        = $07;
  66.  
  67.  
  68. TYPE
  69.     PCIDeviceFunction                    = UInt8;
  70.     PCIBusNumber                        = UInt8;
  71.     PCIRegisterNumber                    = UInt8;
  72.     PCIAssignedAddressPtr = ^PCIAssignedAddress;
  73.     PCIAssignedAddress = PACKED RECORD
  74.         addressSpaceFlags:        PCIAddressSpaceFlags;
  75.         busNumber:                PCIBusNumber;
  76.         deviceFunctionNumber:    PCIDeviceFunction;
  77.         registerNumber:            PCIRegisterNumber;
  78.         address:                UnsignedWide;
  79.         size:                    UnsignedWide;
  80.     END;
  81.  
  82. FUNCTION EndianSwap16Bit(data16: UInt16): UInt16;
  83.     {$IFC NOT GENERATINGCFM}
  84.     INLINE $301F, $E158, $3E80;
  85.     {$ENDC}
  86. FUNCTION EndianSwap32Bit(data32: UInt32): UInt32;
  87.     {$IFC NOT GENERATINGCFM}
  88.     INLINE $201F, $E158, $4840, $E158, $2E80;
  89.     {$ENDC}
  90. FUNCTION ExpMgrConfigReadByte(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt8): OSErr;
  91.     {$IFC NOT GENERATINGCFM}
  92.     INLINE $303C, $0620, $AAF3;
  93.     {$ENDC}
  94. FUNCTION ExpMgrConfigReadWord(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt16): OSErr;
  95.     {$IFC NOT GENERATINGCFM}
  96.     INLINE $303C, $0621, $AAF3;
  97.     {$ENDC}
  98. FUNCTION ExpMgrConfigReadLong(node: RegEntryIDPtr; configAddr: LogicalAddress; VAR valuePtr: UInt32): OSErr;
  99.     {$IFC NOT GENERATINGCFM}
  100.     INLINE $303C, $0622, $AAF3;
  101.     {$ENDC}
  102. FUNCTION ExpMgrConfigWriteByte(node: RegEntryIDPtr; configAddr: LogicalAddress; value: ByteParameter): OSErr;
  103.     {$IFC NOT GENERATINGCFM}
  104.     INLINE $303C, $0523, $AAF3;
  105.     {$ENDC}
  106. FUNCTION ExpMgrConfigWriteWord(node: RegEntryIDPtr; configAddr: LogicalAddress; value: UInt16): OSErr;
  107.     {$IFC NOT GENERATINGCFM}
  108.     INLINE $303C, $0524, $AAF3;
  109.     {$ENDC}
  110. FUNCTION ExpMgrConfigWriteLong(node: RegEntryIDPtr; configAddr: LogicalAddress; value: UInt32): OSErr;
  111.     {$IFC NOT GENERATINGCFM}
  112.     INLINE $303C, $0625, $AAF3;
  113.     {$ENDC}
  114. FUNCTION ExpMgrIOReadByte(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt8): OSErr;
  115.     {$IFC NOT GENERATINGCFM}
  116.     INLINE $303C, $0626, $AAF3;
  117.     {$ENDC}
  118. FUNCTION ExpMgrIOReadWord(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt16): OSErr;
  119.     {$IFC NOT GENERATINGCFM}
  120.     INLINE $303C, $0627, $AAF3;
  121.     {$ENDC}
  122. FUNCTION ExpMgrIOReadLong(node: RegEntryIDPtr; ioAddr: LogicalAddress; VAR valuePtr: UInt32): OSErr;
  123.     {$IFC NOT GENERATINGCFM}
  124.     INLINE $303C, $0628, $AAF3;
  125.     {$ENDC}
  126. FUNCTION ExpMgrIOWriteByte(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: ByteParameter): OSErr;
  127.     {$IFC NOT GENERATINGCFM}
  128.     INLINE $303C, $0529, $AAF3;
  129.     {$ENDC}
  130. FUNCTION ExpMgrIOWriteWord(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: UInt16): OSErr;
  131.     {$IFC NOT GENERATINGCFM}
  132.     INLINE $303C, $052A, $AAF3;
  133.     {$ENDC}
  134. FUNCTION ExpMgrIOWriteLong(node: RegEntryIDPtr; ioAddr: LogicalAddress; value: UInt32): OSErr;
  135.     {$IFC NOT GENERATINGCFM}
  136.     INLINE $303C, $062B, $AAF3;
  137.     {$ENDC}
  138. FUNCTION ExpMgrInterruptAcknowledgeReadByte(entry: RegEntryIDPtr; VAR valuePtr: UInt8): OSErr;
  139.     {$IFC NOT GENERATINGCFM}
  140.     INLINE $303C, $0411, $AAF3;
  141.     {$ENDC}
  142. FUNCTION ExpMgrInterruptAcknowledgeReadWord(entry: RegEntryIDPtr; VAR valuePtr: UInt16): OSErr;
  143.     {$IFC NOT GENERATINGCFM}
  144.     INLINE $303C, $0412, $AAF3;
  145.     {$ENDC}
  146. FUNCTION ExpMgrInterruptAcknowledgeReadLong(entry: RegEntryIDPtr; VAR valuePtr: UInt32): OSErr;
  147.     {$IFC NOT GENERATINGCFM}
  148.     INLINE $303C, $0413, $AAF3;
  149.     {$ENDC}
  150. FUNCTION ExpMgrSpecialCycleWriteLong(entry: RegEntryIDPtr; value: UInt32): OSErr;
  151.     {$IFC NOT GENERATINGCFM}
  152.     INLINE $303C, $0419, $AAF3;
  153.     {$ENDC}
  154. FUNCTION ExpMgrSpecialCycleBroadcastLong(value: UInt32): OSErr;
  155.     {$IFC NOT GENERATINGCFM}
  156.     INLINE $303C, $021A, $AAF3;
  157.     {$ENDC}
  158.  
  159. {$ALIGN RESET}
  160. {$POP}
  161.  
  162. {$SETC UsingIncludes := PCIIncludes}
  163.  
  164. {$ENDC} {__PCI__}
  165.  
  166. {$IFC NOT UsingIncludes}
  167.  END.
  168. {$ENDC}
  169.